package com.qf.controller;

import com.qf.bean.Dept;
import com.qf.service.DeptService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 21/11/2019
 * Echo
 * qmxc
 * Alibaba
 */
@Controller
public class DeptController {
    @Autowired
    private DeptService deptService;
    @RequiresPermissions("dept:selectall")
    @RequestMapping("/Resource/demo2/deptList")
    public String deptList(ModelMap modelMap){
        List<Dept> deptList = deptService.findDeptList();
        modelMap.addAttribute("dlist",deptList);
        return "resource/demo2/add";
    }

}
